<template>
    <div id="container">
        <div class="bgBox">
            <!-- 注册返回 -->
            <div
                v-show="pageType === 'ForgetPawPage'"
                class="backLogin"
                @click="checkPageType('login')"
            >
                <div><i class="el-icon-arrow-left"></i></div>
                <div>返回登录</div>
            </div>
            <!-- 背景 -->
            <div class="circle-one"></div>
            <div class="circle-two"></div>
            <div class="circle-three"></div>
            <!-- 标题 -->
            <div class="header">
                <div class="title">
                    <img src="@/assets/images/logo/logo.png" class="logoImg" />
                    <span class="titleText">智助教育</span>
                </div>
            </div>
            <!-- 页面显示 -->
            <component
                :is="pageType"
                @checkPageType="checkPageType"
            ></component>
            <!-- 页脚 -->
            <div class="footer">
                <div>
                    Copyright @2020 深圳智助教育科技有限公司
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import Login from "./components/login";
import Register from "./components/register";
import RegisterSucc from "./components/registerSucc";
import ForgetPawPage from "./components/forgetPawPage";
import PasswChangedSucc from "./components/passwChangedSucc";
export default {
    components: {
        Login,
        Register,
        RegisterSucc,
        ForgetPawPage,
        PasswChangedSucc
    },
    data() {
        return {
            pageType: "Login"
        };
    },
    methods: {
        checkPageType(type) {
            this.pageType = type;
        }
    }
};
</script>

<style scoped lang="scss">
#container {
    padding: 0;
    margin: 0;
    height: 100%;
}

.bgBox {
    width: 100%;
    height: 100%;
    background: #ebeff5;
    position: relative;
    overflow: hidden;

    .circle-one {
        width: 300px;
        height: 300px;
        border: 50px solid #18db60;
        border-radius: 50%;
        opacity: 0.2;
        position: absolute;
        top: -200px;
        left: -200px;
    }

    .circle-two {
        width: 44px;
        height: 44px;
        border: 15px solid #18db60;
        border-radius: 50%;
        opacity: 0.1;
        position: absolute;
        top: 30%;
        right: 20%;
    }

    .circle-three {
        width: 223px;
        height: 223px;
        border: 100px solid #18db60;
        border-radius: 50%;
        opacity: 0.2;
        position: absolute;
        bottom: -150px;
        right: -150px;
    }

    .backLogin {
        position: absolute;
        top: 15px;
        left: 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        color: #999;
        font-size: 14px;
        z-index: 99999;

        &:hover {
            color: #333333;
        }
    }

    .header {
        margin-top: 115px;
        width: 100%;

        .title {
            height: 46px;
            font-size: 33px;
            font-weight: 600;
            line-height: 46px;
            color: #2d3440;
            width: 300px;
            margin: 0 auto;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .logoImg {
            height: 40.31px;
            width: 59px;
            margin-right: 17.67px;
            margin-left: -55px;
        }
    }

    .footer {
        position: absolute;
        bottom: 25px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 14px;
        color: rgba(0, 0, 0, 0.45);
        text-align: center;
        line-height: 30px;
    }
}

input {
    background: none;
    outline: none;
    border: none;
}

::-webkit-input-placeholder {
    /* Chrome/Opera/Safari */
    color: #cccccc;
    font-size: 14px;
}

::-moz-placeholder {
    /* Firefox 19+ */
    color: #cccccc;
    font-size: 14px;
}

:-ms-input-placeholder {
    /* IE 10+ */
    color: #cccccc;
    font-size: 14px;
}

:-moz-placeholder {
    /* Firefox 18- */
    color: #cccccc;
    font-size: 14px;
}

.from {
    margin-top: 36px;
}

.errfrom {
    width: 100%;
    height: 40px;
    line-height: 40px;
    color: #ff4d4f;
    background: #fff1f0;
    border: 1px solid #ffa099;
    border-radius: 20px;
    padding: 0 20px;
    box-sizing: border-box;
    margin-bottom: 24px;
    font-size: 14px;
    position: relative;
}

.errfrom .layui-icon {
    position: absolute;
    top: 1px;
}

.errfrom .close {
    right: 15px;
    top: -1px;
    cursor: pointer;
}

.errMsg {
    margin-left: 20px;
}

.form-item {
    width: 100%;
    height: 40px;
    background: #ffffff;
    border: 1px solid #dadfe6;
    border-radius: 20px;
    line-height: 40px;
    padding: 0 20px;
    box-sizing: border-box;
    margin-bottom: 24px;
}
.passwordTips {
    color: #ff4d4f;
    padding-left: 8px;
    box-sizing: border-box;
    margin-bottom: 12px;
}
.passwordTips::before {
    content: "*";
    color: #ff4d4f;
}
.form-item .areaCode {
    display: inline-block;
    width: 60px;
    border-right: 1px solid #dadfe6;
    color: #6d7785;
    font-size: 16px;
    margin-right: 15px;
    position: relative;
}

.areaCode .layui-icon {
    font-size: 5px !important;
    color: #dadfe6 !important;
    margin-left: 5px;
    cursor: pointer;
}

.postitBox {
    position: absolute;
    left: -50%;
    /* bottom: -10px; */
    top: 50px;
}

.areaCode .selecodebox {
    width: 150px;
    /* height: 100px; */
    background: #ffffff;
    border: 1px solid #dadfe6;
    border-radius: 5px;
    position: relative;
    box-sizing: border-box;
}

.areaCode .selecodebox-item {
    padding: 2px 15px;
    cursor: pointer;
}

.areaCode .selecodebox-item:hover {
    background: #eeeeee;
}

.areaCode .selecodebox::before {
    display: block;
    content: "";
    border-width: 8px 8px 8px 8px;
    border-style: solid;
    border-color: transparent transparent #ffffff transparent;

    /* 定位 */
    position: absolute;
    left: 40%;
    top: -16px;
}

/* 手机登录 */
.phone-login-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
}

.form-item-phone {
    width: 65%;
    height: 40px;
    background: #ffffff;
    border: 1px solid #dadfe6;
    border-radius: 20px;
    line-height: 40px;
    padding: 0 20px;
    box-sizing: border-box;
}

.visBtn {
    width: 30%;
    height: 40px;
    text-align: center;
    font-size: 15px;
    color: #2d3440;
    background: #ffffff;
    border: 1px solid #dadfe6;
    border-radius: 20px;
    line-height: 40px;
    padding: 0 20px;
    box-sizing: border-box;
    cursor: pointer;
}

.visBtn-green {
    width: 30%;
    height: 40px;
    text-align: center;
    font-size: 15px;
    color: #ffffff;
    background: #018854;
    border: 1px solid #dadfe6;
    border-radius: 20px;
    line-height: 40px;
    padding: 0 20px;
    box-sizing: border-box;
    cursor: pointer;
}

.visBtn-none {
    width: 30%;
    height: 40px;
    text-align: center;
    font-size: 15px;
    color: #ffffff;
    background: #9ea4b0;
    border: 1px solid #dadfe6;
    border-radius: 20px;
    line-height: 40px;
    padding: 0 20px;
    box-sizing: border-box;
    cursor: not-allowed;
}

.countTime {
    background: #eeeeee;
}

/*自定义动画类----顺时针旋转（使用这个动画的时候才设置动画执行时间）*/
@keyframes tranIcon {
    0% {
        -webkit-transform: rotate(0deg);
    }

    25% {
        -webkit-transform: rotate(90deg);
    }

    50% {
        -webkit-transform: rotate(180deg);
    }

    75% {
        -webkit-transform: rotate(270deg);
    }

    100% {
        -webkit-transform: rotate(360deg);
    }
}

.tranIcon {
    animation: tranIcon 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
}

.visBtn:hover {
    background: #eeeeee;
}

.greenTextBtn {
    color: #018854;
    cursor: pointer;
}

.greenTextBtn:hover {
    opacity: 0.8;
}

.sm-btn {
    width: 96px;
    height: 40px;
    border-radius: 20px;
    line-height: 40px;
    border: 1px solid #dadfe6;
    cursor: pointer;
    background: #ffffff;
    font-size: 14px;
}

.sm-btn:hover {
    background: #eeeeee;
}

.greenBgColor {
    background: #018854;
    color: #ffffff;
}

.greenBgColor:hover {
    background: #018854;
    opacity: 0.8;
}
</style>
